#include "GLView.h"

GLView::GLView(QGLContext *context)
    {

}

GLView::GLView()
{

}


void GLView::initializeGL(){




    makeCurrent();

    GLenum err = glewInit();
    if (GLEW_OK != err)
    {

        std::cout << "error: glewInit() failed\n";
    }
    bool vrai = false;
    if(GLEW_VERSION_1_1)
    {
        vrai=true;
    }
    if(GLEW_VERSION_1_5)
    {
        vrai=true;
    }

    if(GLEW_VERSION_2_0)
    {
        vrai=true;
    }

    if(glewIsSupported("GL_VERSION_2_0"))
    {
         vrai=true;
    }

    GLuint id = glCreateShader(GL_FRAGMENT_SHADER);

    glClearColor(1.0, 0.0, 0.0, 0.0);
    glEnable(GL_DEPTH_TEST);
}

void GLView::paintGL(){
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}

void GLView::resizeGL(int w, int h){
    glViewport(0, 0, w, h);
}
